﻿#region Namespace References

using System;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.Interfaces.EventArgClasses
{
    /// <summary>
    /// Argument class passed with ValueChanged event.
    /// </summary>
    public class FieldValueChangedEventArgs : EffectEventArgs
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ValueChangedEventArgs&lt;TDATA&gt;"/> class.
        /// </summary>
        /// <param name="originator">The originator.</param>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        public FieldValueChangedEventArgs(ISmartEntity originator, object oldValue, object newValue) : base(EffectCauses.FieldValueChanged, originator)
        {
            FieldName = String.Empty;
            OldValue = oldValue;
            NewValue = newValue;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ValueChangedEventArgs&lt;TDATA&gt;"/> class.
        /// </summary>
        /// <param name="originator">The originator.</param>
        /// <param name="fieldName">Name of the field.</param>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        public FieldValueChangedEventArgs(ISmartEntity originator, string fieldName, object oldValue, object newValue)
            : base(EffectCauses.FieldValueChanged, originator)
        {
            FieldName = fieldName;
            OldValue = oldValue;
            NewValue = newValue;
        }

        #endregion

        #region Public Static Methods

        #endregion

        #region Public Instance Properties

        /// <summary>
        /// Gets or sets the name of the field.
        /// </summary>
        /// <value>The name of the field.</value>
        public string FieldName { get; private set; }

        /// <summary>
        /// Gets or sets the new value.
        /// </summary>
        /// <value>The new value.</value>
        public object NewValue { get; private set; }

        /// <summary>
        /// Gets or sets the old value.
        /// </summary>
        /// <value>The old value.</value>
        public object OldValue { get; private set; }

 
        #endregion
    }
}